<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>layerDemo1</title>
</head>
<body>
<button id="Layer1">自定义弹出层</button><br/>
<button id="parentIframe">iframe父子操作</button><br/>
<button id="test4">弹出一个loading层</button><br/>
<button id="test5">弹出一个tips层</button><br/>


你必须先引入jQuery1.8或以上版本
<script src="../js/jquery-1.8.3.js"></script>
<script src="../layer/layer.js"></script>
<script type="text/javascript">
//弹出一个页面层
$('#Layer1').on('click', function(){
	  layer.open({
		  type: 1,
		  area: ['600px', '360px'],
		  shadeClose: true, //点击遮罩关闭
		  content: '\<\div style="padding:20px;">自定义内容\<\/div>'
		  });
  
});
//弹出一个iframe层
$('#parentIframe').on('click', function(){
  layer.open({
  type: 2,
  title: 'iframe父子操作',
  maxmin: true,
  shadeClose: true, //点击遮罩关闭层
  area : ['800px' , '520px'],
  content: 'layerDemo2.jsp'
  });
});
//弹出一个loading层
$('#test4').on('click', function(){
  var vv= layer.load();
  //此处用setTimeout演示ajax的回调
  setTimeout(function(){
  layer.close(vv);
  }, 2000);
});
//弹出一个tips层
$('#test5').on('click', function(){
  layer.tips('Hello tips!', '#test5');
});
</script>
</body>
</html>